home *** CD-ROM | disk | FTP | other *** search
/ Champak 106 / Vol 106.iso / games / maple_st.swf / scripts / frame_3 / DoAction_6.as < prev    next >
Encoding:
Text File  |  2010-04-12  |  3.4 KB  |  161 lines

  1. function hotkeyuse()
  2. {
  3.    if(Key.isDown(17))
  4.    {
  5.       if(hotkey.ctrlkey.showgo <= 17 && hotkey.ctrlkey.showgo > 1)
  6.       {
  7.          meuse(hotkey.ctrlkey.targetplace,hotkey.ctrlkey.showgo);
  8.       }
  9.    }
  10.    if(Key.isDown(35))
  11.    {
  12.       if(hotkey.end.showgo <= 17 && hotkey.end.showgo > 1)
  13.       {
  14.          meuse(hotkey.end.targetplace,hotkey.end.showgo);
  15.       }
  16.    }
  17.    if(Key.isDown(36))
  18.    {
  19.       if(hotkey.home.showgo <= 17 && hotkey.home.showgo > 1)
  20.       {
  21.          meuse(hotkey.home.targetplace,hotkey.home.showgo);
  22.       }
  23.    }
  24.    if(Key.isDown(34))
  25.    {
  26.       if(hotkey.pagedown.showgo <= 17 && hotkey.pagedown.showgo > 1)
  27.       {
  28.          meuse(hotkey.pagedown.targetplace,hotkey.pagedown.showgo);
  29.       }
  30.    }
  31.    if(Key.isDown(33))
  32.    {
  33.       if(hotkey.pageup.showgo <= 17 && hotkey.pageup.showgo > 1)
  34.       {
  35.          meuse(hotkey.pageup.targetplace,hotkey.pageup.showgo);
  36.       }
  37.    }
  38.    if(Key.isDown(45))
  39.    {
  40.       if(hotkey.ins.showgo <= 17 && hotkey.ins.showgo > 1)
  41.       {
  42.          meuse(hotkey.ins.targetplace,hotkey.ins.showgo);
  43.       }
  44.    }
  45.    if(Key.isDown(16))
  46.    {
  47.       if(hotkey.shiftkey.showgo <= 17 && hotkey.shiftkey.showgo > 1)
  48.       {
  49.          meuse(hotkey.shiftkey.targetplace,hotkey.shiftkey.showgo);
  50.       }
  51.    }
  52.    if(Key.isDown(46))
  53.    {
  54.       if(hotkey.deletekey.showgo <= 17 && hotkey.deletekey.showgo > 1)
  55.       {
  56.          meuse(hotkey.deletekey.targetplace,hotkey.deletekey.showgo);
  57.       }
  58.    }
  59. }
  60. function meuse(tp, sn)
  61. {
  62.    if(_root.itemwin[tp].itemnum >= 1)
  63.    {
  64.       _root.itemwin[tp].itemnum -= 1;
  65.    }
  66.    else
  67.    {
  68.       _root.itemwin[tp].reset();
  69.    }
  70.    if(sn == 2)
  71.    {
  72.       _root.hp += 90;
  73.    }
  74.    else if(sn == 3)
  75.    {
  76.       _root.hp += Math.round(_root.hpmax * 0.3);
  77.       _root.mp += Math.round(_root.mpmax * 0.3);
  78.    }
  79.    else if(sn == 4)
  80.    {
  81.       _root.hp += 500;
  82.    }
  83.    else if(sn == 5)
  84.    {
  85.       _root.mp += 150;
  86.    }
  87.    else if(sn == 6)
  88.    {
  89.       _root.mp += 300;
  90.    }
  91.    else if(sn == 7)
  92.    {
  93.       _root.hp += 400;
  94.       _root.mp += 300;
  95.    }
  96.    else if(sn == 8)
  97.    {
  98.       _root.hp += 600;
  99.       _root.mp += 200;
  100.    }
  101.    else if(sn == 9)
  102.    {
  103.       _root.hp += Math.round(_root.hpmax * 0.8);
  104.       _root.mp += Math.round(_root.mpmax * 0.8);
  105.    }
  106.    else if(sn == 10)
  107.    {
  108.       _root.hp += 2000;
  109.       _root.mp += 2000;
  110.    }
  111.    else if(sn == 11)
  112.    {
  113.       _root.mp = mpmax;
  114.    }
  115.    else if(sn == 12)
  116.    {
  117.       _root.hp = hpmax;
  118.    }
  119.    else if(sn == 13)
  120.    {
  121.       _root.hp = hpmax;
  122.       _root.mp = mpmax;
  123.    }
  124.    else if(sn == 14)
  125.    {
  126.       _root.hp += Math.round(_root.hpmax * 0.5);
  127.       _root.mp += Math.round(_root.mpmax * 0.5);
  128.    }
  129.    else if(sn == 15)
  130.    {
  131.       _root.hp += Math.round(_root.hpmax * 0.1);
  132.       _root.mp += Math.round(_root.mpmax * 0.1);
  133.    }
  134.    if(_root.hp > _root.hpmax)
  135.    {
  136.       _root.hp = _root.hpmax;
  137.    }
  138.    if(_root.mp > _root.mpmax)
  139.    {
  140.       _root.mp = _root.mpmax;
  141.    }
  142. }
  143. function sameitemscheck(tname, iname)
  144. {
  145.    if(iname != undefined)
  146.    {
  147.       itemspacetest = 0;
  148.       while(itemspacetest <= 24)
  149.       {
  150.          itemimgshowname = "itemimgshow" + itemspacetest;
  151.          if(_root.itemwin[itemimgshowname].showgo == iname)
  152.          {
  153.             _root.hotkey[tname].showgo = _root.itemwin[itemimgshowname].showgo;
  154.             _root.hotkey[tname].targetplace = itemimgshowname;
  155.             break;
  156.          }
  157.          itemspacetest += 1;
  158.       }
  159.    }
  160. }
  161.